package org.jeecg.common.util.tencent.request;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.List;

/**
 * @author guoyh
 * @ClassName ChatMsgRequest
 * @Description
 * @since 2020/8/23 03:07
 **/
@Data
@NoArgsConstructor
public class ChatMsgRequest {

    @JsonProperty(value = "GroupId")
    private String groupId;

    @JsonProperty(value = "From_Account")
    private String fromAccount;

    @JsonProperty(value = "Random")
    private int random;

    @JsonProperty(value = "MsgBody")
    private List<ChatMsgBody> msgBody;

    //todo OfflinePushInfo

    @Data
    @NoArgsConstructor
    @JsonIgnoreProperties(ignoreUnknown = true)
    public static class ChatMsgBody{
        @JsonProperty(value = "MsgType")
        private String msgType;

        @JsonProperty(value = "MsgContent")
        private MessageContent msgContent;

        @Data
        @NoArgsConstructor
        @JsonIgnoreProperties(ignoreUnknown = true)
        public static class MessageContent{
            //文本
            @JsonProperty(value = "Text")
            private String text;

            //自定义
            @JsonProperty(value = "Data")
            private String data;

            @JsonProperty(value = "Desc")
            private String desc;

            @JsonProperty(value = "Ext")
            private String ext;

            @JsonProperty(value = "Sound")
            private String sound;

            //图片消息
            @JsonProperty(value = "ImageFormat")
            private Integer imageFormat;
            @JsonProperty(value = "ImageInfoArray")
            private List<ImageInfo> imageInfoArray;

            @Data
            @NoArgsConstructor
            @JsonIgnoreProperties(ignoreUnknown = true)
            public static class ImageInfo{
                @JsonProperty("Height")
                private Integer height;
                @JsonProperty("Size")
                private Integer size;
                @JsonProperty("Type")
                private Integer type;
                @JsonProperty("URL")
                private String url;
                @JsonProperty("Width")
                private Integer width;
                @JsonProperty("UUID")
                private String uuid;
            }
        }
    }


}
